﻿using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ebusiness_Framework.ConfigCenter
{
    public static class ConfigCenterWebApplicationBuilderExtentions
    {
        /// <summary>
        /// 配置中心
        /// </summary>
        /// <param name="builder"></param>
        /// <returns></returns>
        public static WebApplicationBuilder UseConfigCenter(this WebApplicationBuilder builder) 
        {
            //加载nacos配置
            var config = builder.Configuration;
            config.AddNacosV2Configuration(config.GetSection("Nacos"));
            return builder;
        }
    }
}
